{{ $content := .content | .page.RenderString }}
<div class="list-tree">
{{- $matches := findRESubmatch `<li>([\s\S]*?)(</li|<ul)` $content }}
{{- range $matches }}
  {{- $replacement := "" }}
  {{- $text := index . 1 }}
  {{- $rest := index . 2 }}
  {{- $parts := split $text "|" }}

  {{- if gt (len $parts) 1 }}
    {{- $name := trim (index $parts 0) " \t\n\r" }}

    {{- $style := "" }}
    {{- if ge (len $parts) 3 }}
      {{- $style = trim (index $parts 2) " \t\n\r" }}
    {{- end }}
    {{- $color := "" }}
    {{- $icon := trim (index $parts 1) " \t\n\r" }}
    {{- $boxStyle := partial "_relearn/boxStyle.gotmpl" (dict "style" $style "color" $color "icon" $icon) }}
    {{- $style = $boxStyle.style }}
    {{- $color = $boxStyle.color }}
    {{- $icon = $boxStyle.icon }}

    {{- if $color }}
      {{- $replacement = printf `<li><i class="%s" style="color: %s;"></i><span>%s</span>%s` $icon $color $name $rest }}
    {{- else if $style }}
      {{- $replacement = printf `<li><i class="%s %s cstyle"></i><span>%s</span>%s` $icon $style $name $rest }}
    {{- else }}
      {{- $replacement = printf `<li><i class="%s"></i><span>%s</span>%s` $icon $name $rest }}
    {{- end }}
  {{- end }}

  {{- if $replacement }}
    {{- $content = replace $content (index . 0) $replacement }}
  {{- end }}
{{- end }}
{{- $content | safeHTML -}}
</div>